package org.example.mppg.enums;

import lombok.Getter;

/**
 * @description:
 * @author: bo
 * @create: 2025-06-27 11:09
 */
@Getter
public enum StatusEnum {
    ACTIVE(1, "ACTIVE"),
    INACTIVE(2, "INACTIVE");

    private int code;
    private String desc;

    StatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static StatusEnum fromValue(String value) {
        for (StatusEnum status : values()) {
            if (status.name().equalsIgnoreCase(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("Unknown enum value: " + value);
    }
}

